//封装本地存储数据和读取数据的方法
//token
//本地存储
export const SET_TOKEN =(token:string) =>{
    localStorage.setItem('TOKEN',token);
}
export const SET_USERID=(userId:string)=>{
    localStorage.setItem('USERID',userId);
}
export const SET_USERNAME=(name:string)=>{
    localStorage.setItem('USERNAME',name);
}
export const SET_ADId=(daId:number)=>{
    localStorage.setItem('daId',String(daId));
}
//本地获取
export const GET_TOKEN =() =>{
    return localStorage.getItem('TOKEN');
}
export const GET_ADId=()=>{
    return Number(localStorage.getItem('daId'));
}
export const GET_USERID =() =>{
    return localStorage.getItem('USERID');
}
export const GET_USERNAME =() =>{
    return localStorage.getItem('USERNAME');
}
//退出时清空本地数据
export const REMOVE_ALL = () => {
    localStorage.removeItem('TOKEN');
    localStorage.removeItem('USERID');
    localStorage.removeItem('USERNAME');
    localStorage.removeItem('daId');
}
